import { createRouter, createWebHistory } from 'vue-router';

const routes = [
  { path: '/', name: 'Login', component: () => import('@/views/Login.vue') },
  { path: '/register', name: 'Register', component: () => import('@/views/Register.vue') },
  {
    path: '/',
    component: () => import('@/views/Home.vue'),
    children: [
      { path: 'home', name: 'Home', component: () => import('@/views/Dashboard.vue') },
      { path: 'user/userdata', name: 'UserData', component: () => import('@/views/UserData.vue')},
      { path: 'user/store-list', name: 'UserStoreList', component: () => import('@/views/UserStoreList.vue') },
      { path: 'user/submit', name: 'UserSubmit', component: () => import('@/views/OldUserSubmit.vue')},
      { path: 'user/takeout', name: 'Takeout', component: () => import('@/views/Takeout.vue') },
      { path: 'user/groupbuy', name: 'GroupBuy', component: () => import('@/views/GroupBuy.vue')},
      { path: 'groupbuy-manage', name: 'GroupBuyManage', component: () => import('@/views/GroupBuyManage.vue') },
      { path: 'employee/type1', name: 'EmployeeType1', component: () => import('@/views/EmployeeType1.vue') },
      { path: 'employee/type1/:storeId', name: 'EmployeeType1Detail', component: () => import('@/views/EmployeeType1Detail.vue') },
      { path: 'employee/type2', name: 'EmployeeType2', component: () => import('@/views/EmployeeType2.vue') },
      { path: 'employee/type2/:storeId', name: 'EmployeeType2Detail', component: () => import('@/views/EmployeeType2Detail.vue') },
      { path: 'log', name: 'Log', component: () => import('@/views/Log.vue') },
      { path: 'old-store-manage', name: 'OldStoreManage', component: () => import('@/views/OldStoreManage.vue') },
      { path: 'store-manage', name: 'StoreManage', component: () => import('@/views/StoreManage.vue') },
      { path: 'employee/manage', name: 'EmployeeManage', component: () => import('@/views/EmployeeManage.vue') },
      { path: 'employee/join-store', name: 'JoinStore', component: () => import('@/views/JoinStoreList.vue') },
    ]
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router; 